
import 'package:permission_handler/permission_handler.dart';

class PermissionUtil {

  static Future<bool> reqPer(Permission permission) async {
    PermissionStatus _permissionStatus = await permission.status;
    /// 已授权
    if(_permissionStatus == PermissionStatus.granted){
      return true;
    }
    /// 请求时，同意授权
    _permissionStatus = await permission.request();
    if(_permissionStatus == PermissionStatus.granted){
      return true;
    }
    /// 请求时，未同意授权
    return false;
  }

}